PHASE1: Import DEM raster from Japan Space Systems

PHASE1: Import DEM raster from Japan Space Systems

Summary
This is a preparatory phase to obtain and store elevation details of the land for the entire nation. The elevation details of the land becomes the core cost to build waterway though that land.

STEP1: Download DEM files
Download DEM files from: https://gdemdl.aster.jspacesystems.or.jp/
India's rectangle:
E097-E068 E089-E068
N08-N35
<<Note: it covers around Bangaldesh and little bit of Pakistan>>
Area of interest:
E088-E072
N10-N32
193601=68419
23
3601=82823
68419*82823=5666666837

Example: https://gdemdl.aster.jspacesystems.or.jp/download/Download_N08E068.zip thru Download_N35E097.zip
curl https://gdemdl.aster.jspacesystems.or.jp/download/Download_N08E068.zip -o Download_N08E068.zip
.
.
.
curl https://gdemdl.aster.jspacesystems.or.jp/download/Download_N35E097.zip -o Download_N35E097.zip

https://www.researchgate.net/publication/340482689_ASTER_Global_Digital_Elevation_Model_GDEM_and_ASTER_Global_Water_Body_Dataset_ASTWBD
ASWBD file: The attribute file has four values: 0 for land, 1 for ocean, 2 for river, and 3 for lakes, in GeoTIFF format. The accompanying *.dem file has elevation values for all non-land pixels and is also in GeoTIFF format.
https://www.usna.edu/Users/oceano/pguth/md_help/html/asterdem.htm
There are files with the number of scenes used to get each elevation, with "num" in the file name, which you can delete

STEP2: Review and Analyze DEM files using gistools

Copy DEM files to tif folder

Unzip each of Download_N*.zip DEM files and delete water body files (ASTWBDV001)

Extract land DEM TIF files

listgeo ASTWBDV001_N10E075_dem.tif
Geotiff_Information:
Version: 1
Key_Revision: 1.0
Tagged_Information:
ModelTiepointTag (2,3):
0 0 0
74.9998611111111 11.0001388888889 0
ModelPixelScaleTag (1,3):
0.000277777777777778 0.000277777777777778 0
End_Of_Tags.
Keyed_Information:
GTModelTypeGeoKey (Short,1): ModelTypeGeographic
GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
GeographicTypeGeoKey (Short,1): GCS_WGS_84
GeogLinearUnitsGeoKey (Short,1): Linear_Meter
GeogAngularUnitsGeoKey (Short,1): Angular_Degree
End_Of_Keys.
End_Of_Geotiff.

GCS: 4326/WGS 84
Datum: 6326/World Geodetic System 1984
Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)
Prime Meridian: 8901/Greenwich (0.000000/ 0d 0' 0.00"E)
Projection Linear Units: 9001/metre (1.000000m)

Corner Coordinates:
Upper Left ( 74d59'59.50"E, 11d 0' 0.50"N)
Lower Left ( 74d59'59.50"E, 9d59'59.50"N)
Upper Right ( 76d 0' 0.50"E, 11d 0' 0.50"N)
Lower Right ( 76d 0' 0.50"E, 9d59'59.50"N)
Center ( 75d30' 0.00"E, 10d30' 0.00"N)
GCS: EPSG number of the geographic coordinate system (If it is 4326, then there is no transformation needed)
Projection Linear Units: 1m means vertical units of elevation is 1m

https://postgis.net/docs/using_raster_dataman.html
To see list of raster types supported:
raster2pgsql -G

raster2pgsql -s 4326 -Y -I -C -M -F -t 5000x5000 *dem.tif indiaosm.india_land > india_land.sql
-s 4326 Set SRID to 4326 (what we want!)
-t 5000x5000 tile size (WxH) to be sliced per row
-I Create GiST index
-F Create 'filename' column
-C Apply raster constraints such as SRID, pixel size
-M Vacuum analyze the raster table
-Y Make COPY command instead of INSERT (default max_rows_per_copy=50)

Example DEM Data in QGIS: around Bareily
g2k_dem_layer_N28E079_bareily_low_res.png
Ref: g2k_dem_layer_N28E079_bareily.png